<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MY PRIVATE CLOUD</title>
<script src="/assets/js/def.js"></script>
<style>
.wrap-menu
{
	overflow:auto;
	width:300px;
	background:#F6F6F6;
	font:12px/1.5 Tahoma,Arial,sans-serif;
}

.wrap-menu ul
{
	list-style:none;
	margin:0;
	padding:0;
}

.wrap-menu ul li
{
	text-indent:3em;
	white-space:nowrap;
}

.wrap-menu ul li h2
{
	cursor:pointer;
	height:100%;
	width:100%;
	font:12px/31px 宋体;
	color:#1A385C;
	background:#D7ECF0;
	margin:0 0 1px;
}

.wrap-menu ul li a
{
	display:block;
	outline:none;
	height:25px;
	line-height:25px;
	color:#1A385C;
	text-decoration:none;
	margin:1px 0;
}

.wrap-menu ul li a.current
{
	background:#F99;
	color:#FFF;
	background-color:#5F90CD;
	background-image:none;
}

.wrap-menu ul li img
{
	margin-right:10px;
	margin-left:-17px;
	margin-top:9px;
	width:7px;
	height:7px;
	background:url(/img/arrow.gif) no-repeat;
	border:none;
}

.wrap-menu ul li img.unfold
{
	background-position:0 -9px;
}

.wrap-menu ul li a:hover
{
	background-color:#E1F4FD;
	background-image:none;
}
</style>
<script>
/* start diy js */
/* CITE:http://www.ifrans.cn/jquery-multistage-folding-menu/ */
$(function() {

var wwwRoot="/";

var aMenu = [
{
        "name": "系统管理",
        "submenu": [{
                "name": "管理帐户",
                "url": wwwRoot+"sadmr.html"
        },
        {
                "name": "系统信息",
                "url": "/cgi-bin/sver.cgi"
        },
        {
                "name": "升级服务器",
                "url": "/cgi-bin/upserv.cgi"
        },
		{
				"name":"AC升级",
				"url":wwwRoot+"ac_upgrade.html"
		}]
},
{
        "name": "网络管理",
        "submenu": [{
                "name": "接口管理",
                "url": wwwRoot+"iphy.html"
        },
        {
                "name": "DHCP",
                "url": wwwRoot+"ndhcp.html"
        },
        {
                "name": "DNS",
                "url": wwwRoot+"ndns.html"
        }]
},
{
        "name": "网络安全",
        "submenu": [{
                "name": "ACL",
                "url": wwwRoot+"nacl.html"
        }]
},
{
        "name": "无线管理",
        "submenu": [{
                "name": "分组管理",
                "url": wwwRoot+"group.html",
				"function":"topmenu('group.txt')"
		},
		{
                "name": "设备管理",
                "url": wwwRoot+"dap.html",
				"function":"topmenu('device.txt')"
		},
		{
                "name": "AP升级策略",
                "url": wwwRoot+"upgrade.html"
		}]
},
{
        "name": "用户权限管理",
        "submenu": [{
                "name": "用户管理",
                "url": wwwRoot+"usrinfo.html"
        },
        {
                "name": "权限管理",
                "url": wwwRoot+"rcontrl.html"
        }]
},
{
        "name": "告警管理",
        "submenu": [{
                "name": "告警联动配置",
                "url": wwwRoot+"alinkg.html"
        },
        {
                "name": "告警信息",
                "url": wwwRoot+"ainfo.html"
        }]
},
{
        "name": "日志管理",
        "submenu": [{
                "name": "操作日志",
                "url": wwwRoot+"lopt.html"
        },
        {
                "name": "运行日志",
                "url": wwwRoot+"lrun.html"
        },
		{
                "name": "安全日志",
                "url": wwwRoot+"lsecu.html"
        }]
}];
 
function createMenu(arr) {
        var $ul_1 = $('<ul></ul>');
        $.each(arr,
        function() {
                var $oLi = $('<li><h2>' + this.name + '</h2></li>');
                if (this.submenu) {
                        createSubMenu(this.submenu, $oLi);
                };
                $ul_1.append($oLi);
        });
 
        //层级缩进
        var $oUl = $ul_1;
        var lev = 1;
        var initTextIndent = 2;
        while ($oUl.find('ul').length > 0) {
                initTextIndent = parseInt(initTextIndent) + 2 + 'em'; //增加一个级别，缩进增加2em
                $oUl.children().children('ul').addClass('lev-' + lev)
                            .children('li').css('text-indent', initTextIndent);
                $oUl = $oUl.children().children('ul');
                lev++;
        };
 
        $ul_1.find('ul').hide();
        $ul_1.children(':first').addClass('current').children('ul').show();
        //绑定事件
        $ul_1.find('h2,a').click(function() {
                if ($(this).siblings('ul').length > 0)
                $(this).siblings('ul').slideToggle('fast').end()
                        .children('img').toggleClass('unfold');
                else {
                        $ul_1.find('li,a').removeClass('current');
                        $(this).addClass('current');
                }
                $(this).parent('li').siblings().find('ul').hide()
                        .end().find('img.unfold').removeClass('unfold');
        });
 
        $('.wrap-menu').append($ul_1);
};
//创建子菜单
function createSubMenu(sArr, $tLi) {
        var self = arguments.callee;
        var $sUl = $("<ul></ul>");
        var oUrl, $sLi;
        $.each(sArr,
        function() {
                oUrl = this.url || 'javascript:void(0)';
                $sLi = $('<li><a href="' + oUrl + '">' + this.name + '</a></li>');
                if (this.submenu) {
                        $sLi.children('a').prepend('<img src="'+wwwRoot+'images/blank.gif" alt=""/>');
                        self(this.submenu, $sLi);
                }
                $sUl.append($sLi);
        });
        $tLi.append($sUl);
};
 
createMenu(aMenu);

})


$(document).ready(function(){


});
/* end diy js */
</script>
</head>
<body>
<script>
/* start ready js */
/* end ready js */
</script>
<div class="wrapper">
<!-- start body -->
<div class="wrap-menu"></div>
<!-- end body -->
</div>
</body>
</html>
